<?php
$username = array(
	'name'	=> 'username',
	'id'	=> 'username',
	'size'	=> 30,
	'value' =>  set_value('username')
);

$password = array(
	'name'	=> 'password',
	'id'	=> 'password',
	'size'	=> 30,
	'value' => set_value('password')
);

$confirm_password = array(
	'name'	=> 'confirm_password',
	'id'	=> 'confirm_password',
	'size'	=> 30,
	'value' => set_value('confirm_password')
);

$email = array(
	'name'	=> 'email',
	'id'	=> 'email',
	'maxlength'	=> 80,
	'size'	=> 30,
	'value'	=> set_value('email')
);

$email = array(
	'name'	=> 'email',
	'id'	=> 'email',
	'maxlength'	=> 80,
	'size'	=> 30,
	'value'	=> set_value('email')
);

$role_id = array(
	'name'	=> 'role_id',
	'id'	=> 'role_id',
	'value'	=> set_value('role_id')
);

$captcha = array(
	'name'	=> 'captcha',
	'id'	=> 'captcha'
);
?>

<h3>Register</h3>
<?php echo form_open($this->uri->uri_string())?>

<table class="loginTable">

    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo form_submit('register','Register');?>
        </td>
      </tr>
    </tfoot>
    
    <tbody>
      <?php if(strlen(form_error($username['name'])) > 0): ?>
      	<tr><td colspan="2"><?php echo form_error($username['name'],'<p class="alert"> ','</p>') ?></td></tr>
      <?php endif; ?>
      <tr>
	      <th><?php echo form_label('Username', $username['id']);?>:</th>
	      <td>
	        <?php echo form_input($username)?>
	      </td>	
	  </tr>
	  <?php if(strlen(form_error($password['name'])) > 0): ?>
      	<tr><td colspan="2"><?php echo form_error($password['name'],'<p class="alert"> ','</p>') ?></td></tr>
      <?php endif; ?>
	  <tr>
	      <th><?php echo form_label('Password', $password['id']);?>:</th>
	      <td>
	        <?php echo form_password($password)?>
	      </td>	
	  </tr>
	  <?php if(strlen(form_error($confirm_password['name'])) > 0): ?>
      	<tr><td colspan="2"><?php echo form_error($confirm_password['name'],'<p class="alert"> ','</p>') ?></td></tr>
      <?php endif; ?>
	  <tr>
	      <th><?php echo form_label('Confirm Password', $confirm_password['id']);?>:</th>
	      <td>
	        <?php echo form_password($confirm_password);?>
	      </td>	
	  </tr>
	  <?php if(strlen(form_error($role_id['name'])) > 0): ?>
      	<tr><td colspan="2"><?php echo form_error($role_id['name'],'<p class="alert"> ','</p>') ?></td></tr>
      <?php endif; ?>
	  <tr>
	      <th><?php echo form_label('Account Type', $role_id['id']);?>:</th>
	      <td>
	        <?php echo form_dropdown('role_id', $allRoles, '2'); ?>
	      </td>	
	  </tr>
	  		
	<?php if ($this->dx_auth->captcha_registration): ?>
	     
		<?php if(strlen(form_error($captcha['name'])) > 0): ?>
      		<tr><td colspan="2"><?php echo form_error($captcha['name'],'<p class="alert"> ','</p>') ?></td></tr>
      	<?php endif; ?>    
	
		<tr><td><span class="info"> Enter the code exactly as it appears. There is no zero.</span></td></tr>

		<tr>
	      <th><?php echo form_label('Confirmation Code', $captcha['id']);?>:</th>
	      <td>
	        <?php echo form_input($captcha);?>
	      </td>	
	    </tr>
		
	<?php endif; ?>
	  
</table>


<?php echo form_close()?>
